package com.sixteen.ordering_system.mapper;

import com.sixteen.ordering_system.pojo.Dish;
import com.sixteen.ordering_system.pojo.SysOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sixteen
 * @since 2022-09-16
 */
@Mapper
@Repository
public interface SysOrderMapper extends BaseMapper<SysOrder> {
//    @Select("select * from  sys_order where dish_id=#{dish_id}")
//    List<SysOrder> selectList(@Param("dish_id") Integer dishId);
////    @Select("select * from  sys_order ")
//    List<SysOrder> selectCategoryall();

//    插入订单数据
    Integer insertOrder(SysOrder sysOrder);

//    删除订单
    Integer delOrder(SysOrder sysOrder);

    List<SysOrder> selectOrder();

    List<SysOrder> orderAll(Integer sysUserId);
//    更新订单状态
    Integer updateState(Integer sysOrderId);

    Integer selectOrders(@Param("sys_order_id") Integer orderId);

    Integer updateNum(@Param("number_of_diners") Integer numberOfDiners,
                      @Param("sys_order_id") Integer sysOrderId);
}
